# -*- coding: utf_8 -*-
# @Create   : 2021/8/18 14:28
# @Author   : yh
# @Remark   : 所有模型基类
import time

from pydantic import validator

from mxsoftpy import Model


class MxBaseModel(Model):
    """
    模型基类，有create_time和update_time字段
    """
    create_time: int = int(time.time())
    update_time: int = int(time.time())

    @validator('update_time')
    def update(cls, value):
        return int(time.time())
